package com.itheima.chapter01.array;

import java.util.Scanner;

/*
    评委打分
 */
public class demo5 {
    public static void main(String[] args) {
        int[] arr=new int[7];
        int sum=0;
        int avg=0;

        Scanner sc=new Scanner(System.in);
        for (int i = 0; i <arr.length ; i++) {
            System.out.println("请输入第"+(i+1)+"评委的分数");
            arr[i]=sc.nextInt();

        }
        int max=arr[0];
        int min=arr[0];
        for (int i = 0; i < arr.length; i++) {
             /*int max=arr[0];
            int min=arr[0];*/
            if(max<arr[i]){
                max=arr[i];
            }
            if(min>arr[i]){
                min=arr[i];
            }
            sum+=arr[i];
        }
        System.out.println(max+","+min);
        avg=(sum-max-min)/7;
        System.out.println("评委打分的平均分为："+avg);
    }

}
